﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
namespace _0712502_0712504_DesignPatternGame
{
    public class BulletModelFactory : GameObjectFactory
    {         

        public override void InitPrototypes()
        {
            _nprototype = 3;
            _prototypes = new BulletModel[_nprototype];

            _prototypes[0] = new BulletModel(IDBullet.bullet1, 100);
            _prototypes[0].InitModel(GameResourceContainer.ImageManager.BulletImgs,new Rectangle(0,0,15,15), Vector2.Zero);
            _prototypes[0].SpriteModel.itexture2d = 0;

            _prototypes[1] = new BulletModel(IDBullet.bullet2, 100);
            _prototypes[1].InitModel(GameResourceContainer.ImageManager.BulletImgs, new Rectangle(0, 0, 15, 15), Vector2.Zero);
            _prototypes[1].SpriteModel.itexture2d = 1;

            _prototypes[2] = new BulletModel(IDBullet.bullet3, 100);
            _prototypes[2].InitModel(GameResourceContainer.ImageManager.BulletImgs, new Rectangle(0, 0, 15, 15),Vector2.Zero);
            _prototypes[2].SpriteModel.itexture2d = 2;
            
        }
        public override VisibleGameEntity CreateObject(int idx)
        {
            if ((idx < 0) || (idx >= _nprototype))
            {
                return null;
            }

            return _prototypes[idx].Clone();
        }

        static public VisibleGameEntity Create(int idx)
        {
            return null;
        }
    }
}
